import java.util.ArrayList;

public class Java006 {
    public static void main(String[] args) {
        int[] num1 = new int[]{1,2,3};
        int[] num2 = new int[]{3,4,5,2};//两个数组不能自带重复的数
        ArrayList<Integer> all=fun(num1,num2);

        System.out.println(all);
    }
    public static ArrayList<Integer> fun(int[] num1,int[] num2){
        ArrayList<Integer> all= new ArrayList<>();
        for(int i=0;i<num2.length;i++){
            all.add(num2[i]);
        }
        for(int i=0;i<num1.length;i++){
            if(all.contains(num1[i])){
                all.remove(all.indexOf(num1[i]));
            }else {
                all.add(num1[i]);
            }
        }
        return all;
    }
}
